<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Hard
  </div>
  <div>
   <h1 class="question_title">
    1057. Numbers With Repeated Digits
   </h1>
   <p>
    Given a positive integer
    <code>
     N
    </code>
    , return the number of positive integers less than or equal to
    <code>
     N
    </code>
    that have at least 1 repeated digit.
   </p>
   <p>
    &nbsp;
   </p>
   <div>
    <p>
     <strong>
      Example 1:
     </strong>
    </p>
    <pre>
<strong>Input: </strong><span id="example-input-1-1">20</span>
<strong>Output: </strong><span id="example-output-1">1</span>
<strong>Explanation: </strong>The only positive number (&lt;= 20) with at least 1 repeated digit is 11.
</pre>
    <div>
     <p>
      <strong>
       Example 2:
      </strong>
     </p>
     <pre>
<strong>Input: </strong><span id="example-input-2-1">100</span>
<strong>Output: </strong><span id="example-output-2">10</span>
<strong>Explanation: </strong>The positive numbers (&lt;= 100) with atleast 1 repeated digit are 11, 22, 33, 44, 55, 66, 77, 88, 99, and 100.
</pre>
     <div>
      <p>
       <strong>
        Example 3:
       </strong>
      </p>
      <pre>
<strong>Input: </strong><span id="example-input-3-1">1000</span>
<strong>Output: </strong><span id="example-output-3">262</span>
</pre>
     </div>
     <p>
      &nbsp;
     </p>
     <p>
      <strong>
       <span>
        Note:
       </span>
      </strong>
     </p>
     <ol>
      <li>
       <code>
        1 &lt;= N &lt;= 10^9
       </code>
      </li>
     </ol>
    </div>
   </div>
  </div>
  <div>
   <h1 class="question_title">
    1057. 至少有 1 位重复的数字
   </h1>
   <p>
    给定正整数&nbsp;
    <code>
     N
    </code>
    ，返回小于等于
    <code>
     N
    </code>
    &nbsp;且具有至少 1 位重复数字的正整数。
   </p>
   <p>
    &nbsp;
   </p>
   <p>
    <strong>
     示例 1：
    </strong>
   </p>
   <pre><strong>输入：</strong>20
<strong>输出：</strong>1
<strong>解释：</strong>具有至少 1 位重复数字的正数（&lt;= 20）只有 11 。
</pre>
   <p>
    <strong>
     示例 2：
    </strong>
   </p>
   <pre><strong>输入：</strong>100
<strong>输出：</strong>10
<strong>解释：</strong>具有至少 1 位重复数字的正数（&lt;= 100）有 11，22，33，44，55，66，77，88，99 和 100 。
</pre>
   <p>
    <strong>
     示例 3：
    </strong>
   </p>
   <pre><strong>输入：</strong>1000
<strong>输出：</strong>262
</pre>
   <p>
    &nbsp;
   </p>
   <p>
    <strong>
     提示：
    </strong>
   </p>
   <ol>
    <li>
     <code>
      1 &lt;= N &lt;= 10^9
     </code>
    </li>
   </ol>
  </div>
 </body>
</html>